<?php
/**
 * Created By virus_cms
 * Author: Virus
 * Date: 2020/2/29
 * Time: 15:18
 */

namespace app\admin\validate;


use think\Validate;

class ConfigGroupValidate extends Validate
{
    protected $rule = [
        'id'          => 'require|number|integer',
        'group_name'  => 'require',
        'group_title' => 'require',
    ];

    protected $message = [
        'group_name'  => '配置组变量必须',
        'group_title' => '配置组标题必须',
        'id.require'  => '该配置组不存在',
        'id.number'   => '配置组id必须为数字',
        'id.integer'  => '配置组id必须为整型',
    ];

    protected $scene = [
        'add'  => ['group_name', 'group_title'],
        'edit' => ['id', 'group_name', 'group_title'],
    ];
}